package fr.nts.framework.front.form.html;

import java.io.Serializable;

import fr.nts.framework.front.form.FieldType;

/**
 * Représente un champ input pour un formulaire
 * 
 * @author sco
 * @version 1.0.0
 */
public class FormInput implements Serializable{

	private static final long serialVersionUID = 1L;

	/**
	 * Le nom du champ
	 */
	private String name;
	
	/**
	 * Le label du champ
	 */
	private String label;
	
	/**
	 * La taille du champ
	 */
	private String size;
	
	/**
	 * Le type du champ
	 */
	private FieldType type;

	/**
	 * Valeur du champ
	 */
	private String[] values;
	
	/**
	 * Erreur sur le champ ou pas
	 */
	private boolean hasError = false;

	/**
	 * Obligatoire ou pas
	 */
	private boolean mandatory = false;
	
	// GETTER / SETTER
	public String getName(){
		return name;
	}

	public void setName(String name){
		this.name = name;
	}

	public String getSize(){
		return size;
	}

	public void setSize(String size){
		this.size = size;
	}

	public FieldType getType(){
		return type;
	}

	public void setType(FieldType type){
		this.type = type;
	}

	public String[] getValues(){
		return values;
	}

	public void setValues(String[] values){
		this.values = values;
	}

	public boolean isHasError(){
		return hasError;
	}

	public void setHasError(boolean hasError){
		this.hasError = hasError;
	}

	public boolean isMandatory(){
		return mandatory;
	}

	public void setMandatory(boolean mandatory){
		this.mandatory = mandatory;
	}

	public String getLabel(){
		return label;
	}

	public void setLabel(String label){
		this.label = label;
	}
}